package com.NxIndustries.Sapphire;

import android.app.Activity;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.View;
import android.widget.TextView;

import com.android.launcher3.Launcher;
import com.htc.widget.HtcAlertDialog;

public class FirstRun extends Activity{
	
	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		getWindow();
		setContentView(R.layout.first_run);
	}
	
	public void begin(View v){
	    if(v.getId() == R.id.begin){
	    	showDialog(11);
	    }
	}
	
	@SuppressWarnings("deprecation")
	@Override
	protected Dialog onCreateDialog(int id) {
	    switch (id) {    
	        case 11:
	        // Create our About Dialog
	        TextView aboutMsg  = new TextView(this);
	        aboutMsg.setMovementMethod(LinkMovementMethod.getInstance());
	        aboutMsg.setPadding(30, 30, 30, 30);
	        aboutMsg.setText(Html.fromHtml("Welcome and Thankyou for using Sapphire UI as you Launcher Experience on your HTC Sense 6 powered device! Press Continue to allow Sapphire to finish installing."));

	        HtcAlertDialog.Builder builder = new HtcAlertDialog.Builder(this);
	            builder.setView(aboutMsg)
	            .setTitle(Html.fromHtml("<b>Sapphire Notification</b>"))
	            .setPositiveButton("Continue",
	                    new DialogInterface.OnClickListener() {
	                        @Override
	                        public void onClick(DialogInterface dialog,
	                            int which) {
		                            Intent dialog_intent = new Intent(getBaseContext(), Launcher.class);
		                            startActivity(dialog_intent);
	                        }
	                    });
	        return builder.create();
	    }
	    return super.onCreateDialog(id);
	}

}
